void swap(int* buf1 ,int *buf2)
{
    int temp= *buf1;
    *buf1 = *buf2;
    *buf2 = temp;
}
int removeElement(int* nums, int numsSize, int val)
{
    int left =0,right =numsSize-1;
    while(left<=right)
    {
        if(*(nums+left) == val && *(nums+right) != val)
        {
            swap(&*(nums+left),&*(nums+right));
        }
        if(*(nums+left) != val)
        {
            left++;
        }
        if(*(nums+right) == val)
        {
            right--;
            numsSize--;
        }
    }
    return numsSize;
}